﻿@using LKVMLMADMIN.Models;
@using PagedList.Mvc;
@using System.Globalization;
@using LKVMLMLib;

@{
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
      DateTime a =new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
      DateTime b =new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1);            
}
@using (Html.BeginForm("SaleManager", "CongCu", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-inline" }))
{
    <div id="wrapper">
        <div class="clear-fix"></div>
        <div class="row">
            <div style=" min-height: 110px; padding-left: 30px; ">
                <h3 class="page-header">Quản lý doanh thu</h3>
                <label style="font-family:'Times New Roman'">Từ Ngày &nbsp</label>
                <input type="text" name="Fromdate" class="form-control inputBox" value="@a">
                <label style="font-family:'Times New Roman'">Đến ngày &nbsp</label>
                <input type="text" name="Todate" class="form-control inputBox" value="@b">
                <button type="submit" class="btn_submit btn btn-default">Tìm kiếm</button>             
            </div>
        </div>
        <!-- /.row -->
        <div style=" padding-left: 20px; margin-right: 20px; font-family: 'Times New Roman'">
            <label>Doanh số đầu vào</label>
            <strong class="pull-right ">
                Tổng tiền:&nbsp<i class="mone">
                    @String.Format(CultureInfo.InvariantCulture, "{0:0,0}", ViewBag.Tongdauvao)
                </i> VNĐ
            </strong>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel-body">
                    <div class="dataTable_wrapper">
                        <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                            <thead>
                                <tr style="font-family:'Times New Roman'">
                                    <th>STT</th>
                                    <th>Hoa Hồng</th>
                                    <th>Tổng tiền</th>
                                </tr>
                            </thead>
                            <tbody style="font-family:'Times New Roman'">
                                @{int j = 0;}
                                @foreach (var item in ViewBag.DanhSach)
                                {
                                    j++;
                                    <tr>
                                        <td>@j</td>
                                        <td>@item.ProfitName</td>
                                        <td>@String.Format("{0:0,0}", item.Amount)</td>
                                    </tr>
                                }
                            </tbody>
                        </table>
                    </div>
                    <div style="font-family:'Times New Roman'">
                        <label>Tổng</label>
                        <strong class="pull-right ">
                            Tổng tiền:&nbsp<i class="mone">
                                @String.Format(CultureInfo.InvariantCulture, "{0:0,0}", ViewBag.Daura)
                            </i> VNĐ
                        </strong>
                    </div>
                    <div style="font-family:'Times New Roman'">
                        <label>Lợi nhuận</label>
                        <label>Tổng</label>
                        <strong class="pull-right ">
                            Tổng tiền:&nbsp<i class="mone">
                                @String.Format(CultureInfo.InvariantCulture, "{0:0,0}", ViewBag.Loinhuan)
                            </i> VNĐ
                        </strong>
                    </div>                            
                </div>
            </div>        
        </div>
    </div>
    <script>
        $(document).ready(function () {
            $('#dataTables-example').DataTable({
                responsive: true
            });
        });
    </script>
     @*<script src="~/Scripts/jquery-1.11.0.min.js"></script>*@
        <script src="~/Scripts/fm.datetator-fo.jquery.js"></script>
        <link href="~/Scripts/fm.datetator.jquery.css" rel="stylesheet" />
        <script src="~/Scripts/fm.datetator.jquery.js"></script>
        <script type="text/javascript">
            $('.inputBox').datetator();          
        </script>  
}